/*
 * Mencoder opts analysis with reference MPlayer doc.	
 * author pengl 
 * 
 */
#pragma once

/*
 *	output video codecs 
 */
typedef struct OVC_CODECS_ST {
	char *ovc_name;
	char *ovc_info;
	char *sub_opts;
} OVC_CODECS_ST, *POVC_CODECS_ST;


/*
 *	output audio codecs
 */
typedef struct OAC_CODECS_ST {
	char *oac_name;
	char *oac_info;
	char *sub_opts;
} OAC_CODECS_ST, *POAC_CODECS_ST;

/*
 *	ffmpeg wrapper all codecs
 */
typedef struct FFMPEG_CODECS_ST {
	char *avc_codecs;
	char *info;
}FFMPEG_CODECS_ST, *PFFMPEG_CODECS_ST;

/*
 *	mencoder support file containers
 */
typedef struct MENC_CONTAINERS_ST {
	char *name;
	char *info;
}MENC_CONTAINERS_ST, *PMENC_CONTAINERS_ST;



/*
 *	extern variable define here
 */
extern FFMPEG_CODECS_ST builtin_ffvideo_codecs[];
extern FFMPEG_CODECS_ST builtin_ffaudio_codecs[];
extern OVC_CODECS_ST bulitin_ovc_codecs[];
extern OAC_CODECS_ST bulitin_oac_codecs[];
extern MENC_CONTAINERS_ST builtin_all_containers[];



/************************************************************************/
/* API                                                                      */
/************************************************************************/
void GetFileFormat(const char *fname);




//////////////////////////////////////////////////////////////////////////

class CMencoderopts
{
public:
	CMencoderopts(void);
	~CMencoderopts(void);

	/*
	 *	get specific ffmpeg video codecs from name or index
	 */
	virtual const char *get_ffvideo_codecs(const char *v_name, const int index); //= 0;
	virtual const char *get_ffaudio_codecs(const char *a_name, const int index); // = 0;
	virtual const char *get_ovc_codecs(const char *ovc_name, const int index); // = 0;
	virtual const char *get_oac_codcecs(const char *oac_name, const int index); // = 0;
	virtual const char *get_menc_containers(const char *containers, const int index); // = 0;


	/*
	 *	get sum support codecs or containers
	 */
	virtual int get_sum_ffv() const;// = 0;
	virtual int get_sum_ffa() const;// = 0;
	virtual int get_sum_ovc() const;// = 0;
	virtual int get_sum_oac() const;// = 0;
	virtual int get_sum_container() const;// = 0;
	
protected:

	PFFMPEG_CODECS_ST	m_Pffvideo_codecs;
	PFFMPEG_CODECS_ST	m_Pffaudio_codecs;
	POVC_CODECS_ST		m_Povc_codecs;
	POAC_CODECS_ST		m_Poac_codecs;
	PMENC_CONTAINERS_ST m_menc_containers;

private:
	int m_sum_ffv_codec;
	int m_sum_ffa_codec;
	int m_sum_ovc_codec;
	int m_sum_oac_codec;
	int m_sum_container;
};













